package ithemaday14.Test3;
import java.security.DrbgParameters;
import java.util.Scanner;
public class PhoneTest {
    public static void main(String[] args) {
       Phone []arr=new Phone[3];
        Scanner sc=new Scanner(System.in);
        for (int i = 0; i < arr.length; i++) {
            Phone p=new Phone();
            System.out.println("请输入手机品牌");
            String brand=sc.next();
            p.setBrand(brand);
            System.out.println("请输入手机价格");
            int price=sc.nextInt();
            p.setPrice(price);
            System.out.println("请输入手机颜色");
            String color=sc.next();
            p.setColor(color);
            arr[i]=p;
        }
        int sum=0;
        for (int i = 0; i < arr.length; i++) {
           sum+=arr[i].getPrice();
        }
        double avg = sum * 1.0 / arr.length;
        System.out.println(avg);
    }
}
